 package com.example.chapter04;

import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

 public class ActStartActivity extends AppCompatActivity implements View.OnClickListener {

     private static final String TAG = "ning";

     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         Log.d(TAG, "ActStartActivity onCreate");
         setContentView(R.layout.activity_act_start);
         findViewById(R.id.btn_act_next).setOnClickListener(this);

     }

     @Override
     public void onClick(View v) {
         // 1.在Intent的构造函数中指定
         //Intent intent = new Intent(this, ActFinishActivity.class);
         // 2.调用意图对象的setClass方法指定
         Intent intent = new Intent();
         // intent.setClass(this,ActFinishActivity.class);
         // 3.调用意图对象的setComponent方法指定
         ComponentName component = new ComponentName(this, ActFinishActivity.class);
         intent.setComponent(component);
         startActivity(intent);
     }

     @Override
     protected void onStart() {
         super.onStart();
         Log.d(TAG, "ActStartActivity onStart");
     }

     @Override
     protected void onResume() {
         super.onResume();
         Log.d(TAG, "ActStartActivity onResume");
     }

     @Override
     protected void onPause() {
         super.onPause();
         Log.d(TAG, "ActStartActivity onPause");
     }

     @Override
     protected void onStop() {
         super.onStop();
         Log.d(TAG, "ActStartActivity onStop");
     }

     @Override
     protected void onDestroy() {
         super.onDestroy();
         Log.d(TAG, "ActStartActivity onDestroy");
     }

     @Override
     protected void onRestart() {
         super.onRestart();
         Log.d(TAG, "ActStartActivity onRestart");
     }
 }